#!/bin/bash

DIR="$(dirname "$(realpath "$0")")"
SERVICE_NAME="${1:-cat}"

cd "$DIR" || exit

echo "Refresh service: $SERVICE_NAME ..."
echo "Current directory is: $(pwd)"

sudo docker compose pull "$SERVICE_NAME"
sudo docker compose up -d --no-deps --build "$SERVICE_NAME"

echo "Done."